package com.twu.biblioteca;

import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: thoughtworker
 * Date: 10/14/13
 * Time: 2:44 PM
 * To change this template use File | Settings | File Templates.
 */
public class ValidateUser {
    private Map<String,String> allUsers;

    public ValidateUser(Map<String, String> allUsers) {
        this.allUsers = allUsers;
    }

    public boolean isValidUser(String[] credentials) {
        if(allUsers.get(credentials[0]) != null) {
            if(allUsers.get(credentials[0]).equals(credentials[1])){
                return true;
            }
        }
        return false;
    }
}
